<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class CustomerFeedbackList extends MY_Controller
{

    public function index()
    {
        $this->load->library('c_customerfeedbacklist');

        $sendData = array();
        $sendData['enterpriseId'] = $this->lg_user['enterpriseId'];
        $sendData['channelId'] = $this->lg_user['channelId'];
        $sendData['userType'] = $this->lg_user['type'];
        $sendData['uid'] = $this->lg_user['id'];
        $sendData['password'] = $this->lg_user['password'];

        //制造接口请求
        $url = $this->c_customerfeedbacklist->set_call_items($sendData);
        $param = $this->c_customerfeedbacklist->get_call_items();
        $rs = $this->restcurl->get($url, $param);

        if ($rs['ErrorCode'] == 0 && $rs['Success'] == 1) {
            $this->c_customerfeedbacklist->set_back_items($rs['CallInfo']);
        }

        $this->data['Data'] = $this->c_customerfeedbacklist->get_back_items();
        $this->render('customerfeedbacklist/index', $this->data);
    }

    public function detail(){
        $this->load->library('c_customerfeedback_detail');

        $sendData = array();
        $sendData['enterpriseId'] = $this->lg_user['enterpriseId'];
        $sendData['channelId'] = $this->lg_user['channelId'];
        $sendData['userType'] = $this->lg_user['type'];
        $sendData['uid'] = $this->lg_user['id'];
        $sendData['password'] = $this->lg_user['password'];
        $sendData['refund_id'] = $this->input->get('refund_id');

        //制造接口请求
        $url = $this->c_customerfeedback_detail->set_call_items($sendData);
        $param = $this->c_customerfeedback_detail->get_call_items();
        $rs = $this->restcurl->get($url, $param);

        if ($rs['ErrorCode'] == 0 && $rs['Success'] == 1) {
            $this->c_customerfeedback_detail->set_back_items($rs['CallInfo']);
        }

        $this->data['Data'] = $this->c_customerfeedback_detail->get_back_items();
        $this->render('customerfeedbacklist/detail', $this->data);
    }
}